 <!DOCTYPE html>
 <html lang="en">
 <head>
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <title>Document</title>
 </head>
 <body>
     
     <ul>
         <li><button>按钮1</button></li>
         <li><button>按钮2</button></li>
         <li><button>按钮3</button></li>
         <li><button>按钮4</button></li>
     </ul>
    <script>
        var but=document.getElementsByTagName('button')
        for(let i=0;i<but.length;i++){
            but[i].onclick=function(){
                console.log(i);
            }
        }

        let a=10;
            a=60 
         {
             let a=50;
              {
                  let a=30
              }
         }
         console.log(a);
        console.log(0.1+0.2);
         alert(2**10)
         var ss = ['1','2','3','4','5','6']
         console.log(...ss)
         function aa(z,x){
           return z+x
         }
         console.log(aa(...[20,30]))
           let c=1
           let j=2;
           [c,j]=[j,c];
           console.log(c,j)
           let {name,age,sex} = {name:'张三',age:'18',sex:'男'}
           console.log(name,age,sex)
    </script>
 </body>
 </html>